import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:furniture_demo/constants.dart';
import 'package:furniture_demo/models/Product.dart';
import 'package:furniture_demo/screen/detail/components/body.dart';
import 'package:furniture_demo/size_config.dart';

class DetailIndex extends StatelessWidget {
  const DetailIndex({Key? key, required this.product}) : super(key: key);

  final Product product;
  @override
  Widget build(BuildContext context) {
    SizeConfig().init(context);
    return Scaffold(
      backgroundColor: kSecondaryColor,
      appBar: buildAppBar(context),
      body: Body(product: product),
    );
  }

  AppBar buildAppBar(BuildContext context) {
    return AppBar(
      leading: IconButton(
        icon: SvgPicture.asset('assets/icons/arrow-long-left.svg'),
        onPressed: () {
          Navigator.pop(context);
        },
      ),
      actions: [
        IconButton(
            onPressed: () {}, icon: SvgPicture.asset('assets/icons/bag.svg'))
      ],
    );
  }
}
